1. Field of the Invention
The present invention relates to a method and apparatus of mosaic picture processing, and particularly to a method and apparatus of mosaic picture processing using an image cell as a processing unit.
2. Description of the Prior Art
One of two main conventional picture processing systems is called a frame buffer, which maps each pixel on a screen to some bits of a memory buffer. As shown in the timing allocation diagram of FIG. 1A, only one pixel is read in a time interval using the frame buffer scheme for a 16 bit system. The bandwidth usage is only 50% for processing a picture of 256 colors or 8 bits. Moreover, the bandwidth usage is 25% for processing a picture of 16 colors or 4 bits. The other situations are further listed in Table 1.
TABLE 1 ______________________________________ number of colors 256 16 4 2 depth 8 4 2 1 bandwidth usage 50% 25% 12.5% 6.25% ______________________________________
Owing to the structural simplicity, this frame buffer scheme can be easily constructed, but requires a lot of memory space. For example, 64K bytes memory is needed for a screen having 256 colors and 256.times.256 pixels. Further, these 64K bytes are moved whenever the picture on the screen is updated, consequently slowing down the whole picture processing system.
Another kind of the conventional picture processing systems is a system which uses an image cell in order to save memory space and accelerate the process. The primary advantage of using the image cell is that a pattern defined by the image cell can be repeatedly retrieved, greatly saving the memory space. An address of an image cell is initially generated to obtain an index stored in a pattern name table (PNT), followed by acquiring a pattern data stored in a pattern generation table (PGT) according to the previously obtained index. As the contents of different image cells on the screen are usually the same, and therefore occupy only one block of memory instead of two as in the frame buffer method. More data and attributes such as horizontal mirror data, vertical mirror data and palette are also stored in the PNT in addition to the aforementioned index.
The relationship between the PNT and the PGTs is illustrated in FIGS. 2A to 2E, where an 8.times.8 image cell is used. The color mode of 2 colors, 4 colors, 16 colors and 256 colors are represented by FIG. 2B, FIG. 2C, FIG. 2D and FIG. 2E respectively with depth of 1, 2, 4 and 8. The relationship among the depth, the number of colors and the required memory is further listed in Table 2, where the relationship between the depth and the number of the colors is: number of colors=2.sup.depth. For example, there are 256 or 2.sup.8 colors available for a depth of 8. Also, the relationship between the required memory and the depth is: required memory=8.times.8.times.depth/8 bytes. For example, 64 (or 8.times.8.times.8 8) bytes are required for a depth of 8.
TABLE 2 ______________________________________ depth number of colors memory (byte) ______________________________________ 1 2 8 2 4 16 4 16 32 8 256 64 ______________________________________
FIG. 1B shows the timing diagram of a traditional picture processing system using the image cell, where the index of the PNT is firstly read, and then the PGT data is read. The bandwidth usage of PNT is only 12.5% owing to the fact that the same PNT data of neighboring eight pixels are repeatedly read.
A mosaic picture processing is commonly required in a picture processing system such as a video game, making an image vague purposely or a smooth transition between two images. For example, the picture in FIG. 3A is processed by a mosaic picture processing to produce the picture as shown in FIG. 3B.